#include "Acomb_particle.h"

bool Combine_Get_SameSignLepton(AComb_LTV &signal){

	int num_lp=signal.in.num1;
	int num_lm=signal.in.num2;

	ACut cut;
	if(signal.cuts.m.SWITCH){
		cut=signal.cuts.m;
	}
	else if(signal.cuts.pt.SWITCH){
		cut=signal.cuts.pt;
	}
	else if(signal.cuts.eta.SWITCH){
		cut=signal.cuts.eta;
	}
	else{
	//	ShowMessage(2,"Error: in Combine_Get_SameSignLepton: Wrong cut, no any cut open, check their SWITCH", signal.cuts);
		exit(0);
	}

	//ShowMessage(2,"lepton number",num_lm, num_lp, cut.obj);

	if(num_lm<cut.obj && num_lp<cut.obj){
		//ShowMessage(2,"no enough SS lepton,  return false");
		signal.Set_Kind(0);
		signal.Flow_In_to_Left();
		return(false);
	}
	else{
		if(num_lm>=cut.obj){
			//ShowMessage(2,"find two same sign lepton, charged is minus",num_lm);
			signal.Set_Kind(-1);
			signal.Set_Out_with_Pos(0,1);
		}
		else{
			//ShowMessage(2,"find two same sign lepton, charge is plus ", num_lp);
			signal.Set_Kind(1);
			signal.Set_Out_with_Pos(0,1);
		}
		return(true);
	}


}
